package com.gxa.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.gxa.common.base.RespResult;
import com.gxa.domain.dto.NewGoodsDto;
import com.gxa.domain.entity.NewGoods;
import com.gxa.mapper.NewGoodsMapper;
import com.gxa.service.NewGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 吴邓江
 * 大帅哥
 */
@Service
@Transactional(rollbackFor = Throwable.class)
public class NewGoodsServiceImpl extends ServiceImpl<NewGoodsMapper, NewGoods> implements NewGoodsService {
    @Autowired
    private NewGoodsMapper newGoodsMapper;
    @Override
    public RespResult pagequery(NewGoodsDto newGoodsDto) {
        PageHelper.startPage(newGoodsDto.getPage(), newGoodsDto.getPageSize());
        List<NewGoods> newGoodsList = newGoodsMapper.pagequery(newGoodsDto);
        return RespResult.success(newGoodsList);
    }
}
